IdeaBlade DevForce 2010 Help Reference
GetterInterceptor Property
See Also  Example Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > NavigationListEntityProperty<TInstance,TValue> Class : GetterInterceptor Property



The getter PropertyInterceptor.

Syntax

Example

C#Copy Code
public void Sample() {

  // Add a BeforeGet action to a GetterInterceptor:
  Employee.PropertyMetadata.DirectReports.GetterInterceptor.AddAction(
    PropertyInterceptorTiming.Before,
    TraceGetter);

  // Add a BeforeSet action to a SetterInterceptor (a SetterInterceptor is available
  // only for scalar and non-readonly navigation properties).
  Employee.PropertyMetadata..Manager.SetterInterceptor.AddAction(
    PropertyInterceptorTiming.Before,
    TraceSetter);

  // Get/set a few properties
  DomainModelEntityManager mgr = new DomainModelEntityManager();
  Employee e = mgr.Employees.First();
  e.Manager = null;         
  var list = e.DirectReports;
}

public static void TraceGetter(IEntityPropertyGetInterceptorArgs args) {
  Console.WriteLine("getter called for " + args.EntityProperty.Name);
}

public static void TraceSetter(IEntityPropertySetInterceptorArgs args) {
  Console.WriteLine("setter called for " + args.EntityProperty.Name);
}

Remarks

Use the GetterInterceptor to add custom BeforeGet and AfterGet interception actions to a property getter.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.